package org.game.module.chatbo.testcmd;

import com.sojoys.artifact.core.IServer;
import com.sojoys.artifact.tools.ToolList;
import org.game.db.bean.Player;
import org.game.db.bean.Role;
import org.game.log.builder.LogDsp;
import org.game.log.dsp.GoodsDsp;
import org.game.manager.RoleManager;
import org.game.module.datingbo.DatingBO;

import java.util.List;

/**
 * Created by fxf on 2018-4-2.
 */
public class RoleTest {

    public static byte[] dispatcher(Player player, List<String> cmds){
        int index = ToolList.getInt(1, cmds);
        byte[] result = new byte[0];
        switch (index){
            case 1:{
                fullAllMood(player);
                break;
            }
            case 2:{
                fullAllFavor(player);
            }
        }
        return result;
    }

    private static void fullAllMood(Player player){
        List<Role> roleList = player.getRolesFkPlayerId();
        for (Role role : roleList) {
            RoleManager.me().changeMood(role,100, LogDsp.newBuilder(GoodsDsp.GM_MAIL));
            role.update();
        }
    }

    private static void fullAllFavor(Player player){
        List<Role> roleList = player.getRolesFkPlayerId();
        for (Role role : roleList) {
            RoleManager.me().changeFavor(role,10000, LogDsp.newBuilder(GoodsDsp.GM_MAIL));
            role.update();
        }
    }

}
